home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / progjour / 1988 / 05 / pseudo.cod < prev    next >
Text File  |  1988-08-18  |  1KB  |  51 lines

  1. Copyright Gordon Arbeitman, 1988.  All Rights Reserved.
  2.  
  3. SOFTWARE PSEUDOCODE
  4.  
  5. PC SIDE
  6.  
  7. EQUATES
  8.  
  9. PrintPort = $0379  /* for printer card */
  10. PrintPort = $03BD  /* for mono card */
  11. EOF       = $FFFF  /* End of file marker .. must be > 128 */
  12.  
  13. Procedure WaitForStrobe ;
  14.  
  15.    Repeat
  16.        Strobe := IN (PrintPort) AND $40 ; /* read bit 6 ->> pin 10 */
  17.    until Strobe = 1 ;
  18.  
  19.    Repeat
  20.        Strobe := IN (PrintPort) AND $40 ; /* read bit 6 ->> pin
  21. 10 */
  22.    until Strobe = 0 ;
  23.  
  24. End ; 
  25.  
  26. Repeat
  27.  
  28.     WaitForStrobe ;
  29.     Inbyte := IN (PrintPort) AND $B8 ; /* Get the low nybble */
  30.     WaitForStrobe ;
  31.     Temp := ShiftLeft (IN (PrintPort) AND $B8), 4 ; /* Get the
  32. high nybble */
  33.     InByte := InByte OR Temp ;
  34.     Store InByte .. or send it to the printer or whatever ;
  35. Until (InByte = EOF) ;
  36.  
  37. END
  38.  
  39. MINICOMPUTER SIDE
  40.  
  41. Repeat for each OutByte ;
  42.  
  43.     Print OutByte ;                    /* send the low nybble */
  44.     ShiftRight OutByte, 4 ;
  45.     Print OutByte ;                    /* send the high nybble */
  46.  
  47. Until (NoMoreCharacters) ;
  48.  
  49. Print EOF ;
  50. END.
  51.